import { SWFPlayer } from "../../scene/modle/SWFPlayer";
import { EventName } from "../../mvc/EventName";
import { ModelUtil } from "../../scene/player/info/ModelUtil";
import { ModelType } from "../../scene/modle/data/ModelType";
type int = number;
//class PetAnimateItem
    
    export  class PetAnimateItem /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            this._animatePlayer = new SWFPlayer();
            this._animatePlayer.x = 0;
            this._animatePlayer.y = 0;
            this._animatePlayer.loadComplete = this.loadSWFComplete;
            addChild(this._animatePlayer);
            return;
        }

        /* internal  */loadSWFComplete(arg1: Object): void
        {
            this.dispatchEvent(new Object /* flash.events.Event */(EventName.PetModleLoadComplete));
            return;
        }

        public updateAnimate(arg1: int): void
        {
            if (this._animatePlayer == null) 
            {
                this._animatePlayer = new SWFPlayer();
            }
            this._animatePlayer.move(0, 0);
            this._animatePlayer.load(ModelUtil.getModelSWF(arg1), ModelType.Monster, null);
            if (this.contains(this._animatePlayer) == false) 
            {
                this.addChild(this._animatePlayer);
            }
            return;
        }

        public stopAnimate(): void
        {
            if (this._animatePlayer) 
            {
                this._animatePlayer.stop();
            }
            return;
        }

        public disposeAnimate(): void
        {
            if (this._animatePlayer) 
            {
                this._animatePlayer.dispose();
            }
            return;
        }

        /* internal */ /* var */_animatePlayer: SWFPlayer;
    }
